package com.study01;

public class Person {
    public String name;
    private int age;
    private int weight;


    public void setAge(int age) throws PersonAgeException{
        if(age < 0 || age > 100){
            throw new PersonAgeException("请检查您输入的年龄");
        }
        this.age = age;
        System.out.println(this.age);
    }

    public void setWeight(int weight) throws PersonWeightException{
        if(weight < 0 || weight > 500){
            throw new PersonWeightException("请检查您的体重");
        }
        this.weight = weight;

    }
}
